// Copyright 2019 The Clspv Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef CLSPV_LIB_BUILTINSMAP_INC_
#define CLSPV_LIB_BUILTINSMAP_INC_

#include <cstdint>

////////////////////////////////////////////////////////////////////////////////
// utilities for const char* map keys
struct cstr_hash {
#define FNV_PRIME_64 UINT64_C(1099511628211)
#define FNV_OFFSET_64 UINT64_C(14695981039346656037)
  // hash function for const char* hashmap based on FNV-1a
  std::uint64_t operator()(const char *cstr) const {
    std::uint64_t hash = FNV_OFFSET_64;
    for (char c = *cstr; c != '\0'; c = *(++cstr)) {
      hash ^= static_cast<std::uint64_t>(c);
      hash *= static_cast<std::uint64_t>(FNV_PRIME_64);
    }
    return hash;
  }
};

struct cstr_eq {
  // Returns true if the two C-style strings are equal. Assumes they are both
  // null-terminated.
  bool operator()(const char *a, const char *b) const {
    return strcmp(a, b) == 0;
  }
};

// static map of builtin function names
static std::unordered_map<const char *, Builtins::BuiltinType, cstr_hash,
                          cstr_eq>
    s_func_map = {

        // Async
        {"async_work_group_copy", Builtins::kAsyncWorkGroupCopy},
        {"async_work_group_strided_copy", Builtins::kAsyncWorkGroupStridedCopy},
        {"wait_group_events", Builtins::kWaitGroupEvents},
        {"prefetch", Builtins::kPrefetch},

        // Atomic
        {"atomic_init", Builtins::kAtomicInit},
        {"atomic_add", Builtins::kAtomicAdd},
        {"atom_add", Builtins::kAtomicAdd},
        {"atomic_sub", Builtins::kAtomicSub},
        {"atom_sub", Builtins::kAtomicSub},
        {"atomic_inc", Builtins::kAtomicInc},
        {"atom_inc", Builtins::kAtomicInc},
        {"atomic_dec", Builtins::kAtomicDec},
        {"atom_dec", Builtins::kAtomicDec},
        {"atomic_xchg", Builtins::kAtomicXchg},
        {"atom_xchg", Builtins::kAtomicXchg},
        {"atomic_cmpxchg", Builtins::kAtomicCmpxchg},
        {"atom_cmpxchg", Builtins::kAtomicCmpxchg},
        {"atomic_min", Builtins::kAtomicMin},
        {"atom_min", Builtins::kAtomicMin},
        {"atomic_max", Builtins::kAtomicMax},
        {"atom_max", Builtins::kAtomicMax},
        {"atomic_and", Builtins::kAtomicAnd},
        {"atom_and", Builtins::kAtomicAnd},
        {"atomic_or", Builtins::kAtomicOr},
        {"atom_or", Builtins::kAtomicOr},
        {"atomic_xor", Builtins::kAtomicXor},
        {"atom_xor", Builtins::kAtomicXor},
        {"atomic_work_item_fence", Builtins::kAtomicWorkItemFence},
        {"atomic_store", Builtins::kAtomicStore},
        {"atomic_store_explicit", Builtins::kAtomicStoreExplicit},
        {"atomic_load", Builtins::kAtomicLoad},
        {"atomic_load_explicit", Builtins::kAtomicLoadExplicit},
        {"atomic_exchange", Builtins::kAtomicExchange},
        {"atomic_exchange_explicit", Builtins::kAtomicExchangeExplicit},
        {"atomic_compare_exchange_strong",
         Builtins::kAtomicCompareExchangeStrong},
        {"atomic_compare_exchange_strong_explicit",
         Builtins::kAtomicCompareExchangeStrongExplicit},
        {"atomic_compare_exchange_weak", Builtins::kAtomicCompareExchangeWeak},
        {"atomic_compare_exchange_weak_explicit",
         Builtins::kAtomicCompareExchangeWeakExplicit},
        {"atomic_fetch_add", Builtins::kAtomicFetchAdd},
        {"atomic_fetch_add_explicit", Builtins::kAtomicFetchAddExplicit},
        {"atomic_fetch_sub", Builtins::kAtomicFetchSub},
        {"atomic_fetch_sub_explicit", Builtins::kAtomicFetchSubExplicit},
        {"atomic_fetch_or", Builtins::kAtomicFetchOr},
        {"atomic_fetch_or_explicit", Builtins::kAtomicFetchOrExplicit},
        {"atomic_fetch_xor", Builtins::kAtomicFetchXor},
        {"atomic_fetch_xor_explicit", Builtins::kAtomicFetchXorExplicit},
        {"atomic_fetch_and", Builtins::kAtomicFetchAnd},
        {"atomic_fetch_and_explicit", Builtins::kAtomicFetchAndExplicit},
        {"atomic_fetch_min", Builtins::kAtomicFetchMin},
        {"atomic_fetch_min_explicit", Builtins::kAtomicFetchMinExplicit},
        {"atomic_fetch_max", Builtins::kAtomicFetchMax},
        {"atomic_fetch_max_explicit", Builtins::kAtomicFetchMaxExplicit},
        {"atomic_flag_test_and_set", Builtins::kAtomicFlagTestAndSet},
        {"atomic_flag_test_and_set_explicit",
         Builtins::kAtomicFlagTestAndSetExplicit},
        {"atomic_flag_clear", Builtins::kAtomicFlagClear},
        {"atomic_flag_clear_explicit", Builtins::kAtomicFlagClearExplicit},

        // Common
        {"degrees", Builtins::kDegrees},
        {"mix", Builtins::kMix},
        {"radians", Builtins::kRadians},
        {"sign", Builtins::kSign},
        {"smoothstep", Builtins::kSmoothstep},
        {"step", Builtins::kStep},

        // Convert
        {"convert_char", Builtins::kConvert},
        {"convert_char_rte", Builtins::kConvert},
        {"convert_char_rtz", Builtins::kConvert},
        {"convert_char_rtp", Builtins::kConvert},
        {"convert_char_rtn", Builtins::kConvert},
        {"convert_char_sat", Builtins::kConvert},
        {"convert_char_sat_rte", Builtins::kConvert},
        {"convert_char_sat_rtz", Builtins::kConvert},
        {"convert_char_sat_rtp", Builtins::kConvert},
        {"convert_char_sat_rtn", Builtins::kConvert},
        {"convert_char", Builtins::kConvert},
        {"convert_char_rte", Builtins::kConvert},
        {"convert_char_rtz", Builtins::kConvert},
        {"convert_char_rtp", Builtins::kConvert},
        {"convert_char_rtn", Builtins::kConvert},
        {"convert_char_sat", Builtins::kConvert},
        {"convert_char_sat_rte", Builtins::kConvert},
        {"convert_char_sat_rtz", Builtins::kConvert},
        {"convert_char_sat_rtp", Builtins::kConvert},
        {"convert_char_sat_rtn", Builtins::kConvert},
        {"convert_char2", Builtins::kConvert},
        {"convert_char2_rte", Builtins::kConvert},
        {"convert_char2_rtz", Builtins::kConvert},
        {"convert_char2_rtp", Builtins::kConvert},
        {"convert_char2_rtn", Builtins::kConvert},
        {"convert_char2_sat", Builtins::kConvert},
        {"convert_char2_sat_rte", Builtins::kConvert},
        {"convert_char2_sat_rtz", Builtins::kConvert},
        {"convert_char2_sat_rtp", Builtins::kConvert},
        {"convert_char2_sat_rtn", Builtins::kConvert},
        {"convert_char3", Builtins::kConvert},
        {"convert_char3_rte", Builtins::kConvert},
        {"convert_char3_rtz", Builtins::kConvert},
        {"convert_char3_rtp", Builtins::kConvert},
        {"convert_char3_rtn", Builtins::kConvert},
        {"convert_char3_sat", Builtins::kConvert},
        {"convert_char3_sat_rte", Builtins::kConvert},
        {"convert_char3_sat_rtz", Builtins::kConvert},
        {"convert_char3_sat_rtp", Builtins::kConvert},
        {"convert_char3_sat_rtn", Builtins::kConvert},
        {"convert_char4", Builtins::kConvert},
        {"convert_char4_rte", Builtins::kConvert},
        {"convert_char4_rtz", Builtins::kConvert},
        {"convert_char4_rtp", Builtins::kConvert},
        {"convert_char4_rtn", Builtins::kConvert},
        {"convert_char4_sat", Builtins::kConvert},
        {"convert_char4_sat_rte", Builtins::kConvert},
        {"convert_char4_sat_rtz", Builtins::kConvert},
        {"convert_char4_sat_rtp", Builtins::kConvert},
        {"convert_char4_sat_rtn", Builtins::kConvert},
        {"convert_char8", Builtins::kConvert},
        {"convert_char8_rte", Builtins::kConvert},
        {"convert_char8_rtz", Builtins::kConvert},
        {"convert_char8_rtp", Builtins::kConvert},
        {"convert_char8_rtn", Builtins::kConvert},
        {"convert_char8_sat", Builtins::kConvert},
        {"convert_char8_sat_rte", Builtins::kConvert},
        {"convert_char8_sat_rtz", Builtins::kConvert},
        {"convert_char8_sat_rtp", Builtins::kConvert},
        {"convert_char8_sat_rtn", Builtins::kConvert},
        {"convert_char16", Builtins::kConvert},
        {"convert_char16_rte", Builtins::kConvert},
        {"convert_char16_rtz", Builtins::kConvert},
        {"convert_char16_rtp", Builtins::kConvert},
        {"convert_char16_rtn", Builtins::kConvert},
        {"convert_char16_sat", Builtins::kConvert},
        {"convert_char16_sat_rte", Builtins::kConvert},
        {"convert_char16_sat_rtz", Builtins::kConvert},
        {"convert_char16_sat_rtp", Builtins::kConvert},
        {"convert_char16_sat_rtn", Builtins::kConvert},
        {"convert_uchar", Builtins::kConvert},
        {"convert_uchar_rte", Builtins::kConvert},
        {"convert_uchar_rtz", Builtins::kConvert},
        {"convert_uchar_rtp", Builtins::kConvert},
        {"convert_uchar_rtn", Builtins::kConvert},
        {"convert_uchar_sat", Builtins::kConvert},
        {"convert_uchar_sat_rte", Builtins::kConvert},
        {"convert_uchar_sat_rtz", Builtins::kConvert},
        {"convert_uchar_sat_rtp", Builtins::kConvert},
        {"convert_uchar_sat_rtn", Builtins::kConvert},
        {"convert_uchar", Builtins::kConvert},
        {"convert_uchar_rte", Builtins::kConvert},
        {"convert_uchar_rtz", Builtins::kConvert},
        {"convert_uchar_rtp", Builtins::kConvert},
        {"convert_uchar_rtn", Builtins::kConvert},
        {"convert_uchar_sat", Builtins::kConvert},
        {"convert_uchar_sat_rte", Builtins::kConvert},
        {"convert_uchar_sat_rtz", Builtins::kConvert},
        {"convert_uchar_sat_rtp", Builtins::kConvert},
        {"convert_uchar_sat_rtn", Builtins::kConvert},
        {"convert_uchar2", Builtins::kConvert},
        {"convert_uchar2_rte", Builtins::kConvert},
        {"convert_uchar2_rtz", Builtins::kConvert},
        {"convert_uchar2_rtp", Builtins::kConvert},
        {"convert_uchar2_rtn", Builtins::kConvert},
        {"convert_uchar2_sat", Builtins::kConvert},
        {"convert_uchar2_sat_rte", Builtins::kConvert},
        {"convert_uchar2_sat_rtz", Builtins::kConvert},
        {"convert_uchar2_sat_rtp", Builtins::kConvert},
        {"convert_uchar2_sat_rtn", Builtins::kConvert},
        {"convert_uchar3", Builtins::kConvert},
        {"convert_uchar3_rte", Builtins::kConvert},
        {"convert_uchar3_rtz", Builtins::kConvert},
        {"convert_uchar3_rtp", Builtins::kConvert},
        {"convert_uchar3_rtn", Builtins::kConvert},
        {"convert_uchar3_sat", Builtins::kConvert},
        {"convert_uchar3_sat_rte", Builtins::kConvert},
        {"convert_uchar3_sat_rtz", Builtins::kConvert},
        {"convert_uchar3_sat_rtp", Builtins::kConvert},
        {"convert_uchar3_sat_rtn", Builtins::kConvert},
        {"convert_uchar4", Builtins::kConvert},
        {"convert_uchar4_rte", Builtins::kConvert},
        {"convert_uchar4_rtz", Builtins::kConvert},
        {"convert_uchar4_rtp", Builtins::kConvert},
        {"convert_uchar4_rtn", Builtins::kConvert},
        {"convert_uchar4_sat", Builtins::kConvert},
        {"convert_uchar4_sat_rte", Builtins::kConvert},
        {"convert_uchar4_sat_rtz", Builtins::kConvert},
        {"convert_uchar4_sat_rtp", Builtins::kConvert},
        {"convert_uchar4_sat_rtn", Builtins::kConvert},
        {"convert_uchar8", Builtins::kConvert},
        {"convert_uchar8_rte", Builtins::kConvert},
        {"convert_uchar8_rtz", Builtins::kConvert},
        {"convert_uchar8_rtp", Builtins::kConvert},
        {"convert_uchar8_rtn", Builtins::kConvert},
        {"convert_uchar8_sat", Builtins::kConvert},
        {"convert_uchar8_sat_rte", Builtins::kConvert},
        {"convert_uchar8_sat_rtz", Builtins::kConvert},
        {"convert_uchar8_sat_rtp", Builtins::kConvert},
        {"convert_uchar8_sat_rtn", Builtins::kConvert},
        {"convert_uchar16", Builtins::kConvert},
        {"convert_uchar16_rte", Builtins::kConvert},
        {"convert_uchar16_rtz", Builtins::kConvert},
        {"convert_uchar16_rtp", Builtins::kConvert},
        {"convert_uchar16_rtn", Builtins::kConvert},
        {"convert_uchar16_sat", Builtins::kConvert},
        {"convert_uchar16_sat_rte", Builtins::kConvert},
        {"convert_uchar16_sat_rtz", Builtins::kConvert},
        {"convert_uchar16_sat_rtp", Builtins::kConvert},
        {"convert_uchar16_sat_rtn", Builtins::kConvert},
        {"convert_short", Builtins::kConvert},
        {"convert_short_rte", Builtins::kConvert},
        {"convert_short_rtz", Builtins::kConvert},
        {"convert_short_rtp", Builtins::kConvert},
        {"convert_short_rtn", Builtins::kConvert},
        {"convert_short_sat", Builtins::kConvert},
        {"convert_short_sat_rte", Builtins::kConvert},
        {"convert_short_sat_rtz", Builtins::kConvert},
        {"convert_short_sat_rtp", Builtins::kConvert},
        {"convert_short_sat_rtn", Builtins::kConvert},
        {"convert_short", Builtins::kConvert},
        {"convert_short_rte", Builtins::kConvert},
        {"convert_short_rtz", Builtins::kConvert},
        {"convert_short_rtp", Builtins::kConvert},
        {"convert_short_rtn", Builtins::kConvert},
        {"convert_short_sat", Builtins::kConvert},
        {"convert_short_sat_rte", Builtins::kConvert},
        {"convert_short_sat_rtz", Builtins::kConvert},
        {"convert_short_sat_rtp", Builtins::kConvert},
        {"convert_short_sat_rtn", Builtins::kConvert},
        {"convert_short2", Builtins::kConvert},
        {"convert_short2_rte", Builtins::kConvert},
        {"convert_short2_rtz", Builtins::kConvert},
        {"convert_short2_rtp", Builtins::kConvert},
        {"convert_short2_rtn", Builtins::kConvert},
        {"convert_short2_sat", Builtins::kConvert},
        {"convert_short2_sat_rte", Builtins::kConvert},
        {"convert_short2_sat_rtz", Builtins::kConvert},
        {"convert_short2_sat_rtp", Builtins::kConvert},
        {"convert_short2_sat_rtn", Builtins::kConvert},
        {"convert_short3", Builtins::kConvert},
        {"convert_short3_rte", Builtins::kConvert},
        {"convert_short3_rtz", Builtins::kConvert},
        {"convert_short3_rtp", Builtins::kConvert},
        {"convert_short3_rtn", Builtins::kConvert},
        {"convert_short3_sat", Builtins::kConvert},
        {"convert_short3_sat_rte", Builtins::kConvert},
        {"convert_short3_sat_rtz", Builtins::kConvert},
        {"convert_short3_sat_rtp", Builtins::kConvert},
        {"convert_short3_sat_rtn", Builtins::kConvert},
        {"convert_short4", Builtins::kConvert},
        {"convert_short4_rte", Builtins::kConvert},
        {"convert_short4_rtz", Builtins::kConvert},
        {"convert_short4_rtp", Builtins::kConvert},
        {"convert_short4_rtn", Builtins::kConvert},
        {"convert_short4_sat", Builtins::kConvert},
        {"convert_short4_sat_rte", Builtins::kConvert},
        {"convert_short4_sat_rtz", Builtins::kConvert},
        {"convert_short4_sat_rtp", Builtins::kConvert},
        {"convert_short4_sat_rtn", Builtins::kConvert},
        {"convert_short8", Builtins::kConvert},
        {"convert_short8_rte", Builtins::kConvert},
        {"convert_short8_rtz", Builtins::kConvert},
        {"convert_short8_rtp", Builtins::kConvert},
        {"convert_short8_rtn", Builtins::kConvert},
        {"convert_short8_sat", Builtins::kConvert},
        {"convert_short8_sat_rte", Builtins::kConvert},
        {"convert_short8_sat_rtz", Builtins::kConvert},
        {"convert_short8_sat_rtp", Builtins::kConvert},
        {"convert_short8_sat_rtn", Builtins::kConvert},
        {"convert_short16", Builtins::kConvert},
        {"convert_short16_rte", Builtins::kConvert},
        {"convert_short16_rtz", Builtins::kConvert},
        {"convert_short16_rtp", Builtins::kConvert},
        {"convert_short16_rtn", Builtins::kConvert},
        {"convert_short16_sat", Builtins::kConvert},
        {"convert_short16_sat_rte", Builtins::kConvert},
        {"convert_short16_sat_rtz", Builtins::kConvert},
        {"convert_short16_sat_rtp", Builtins::kConvert},
        {"convert_short16_sat_rtn", Builtins::kConvert},
        {"convert_ushort", Builtins::kConvert},
        {"convert_ushort_rte", Builtins::kConvert},
        {"convert_ushort_rtz", Builtins::kConvert},
        {"convert_ushort_rtp", Builtins::kConvert},
        {"convert_ushort_rtn", Builtins::kConvert},
        {"convert_ushort_sat", Builtins::kConvert},
        {"convert_ushort_sat_rte", Builtins::kConvert},
        {"convert_ushort_sat_rtz", Builtins::kConvert},
        {"convert_ushort_sat_rtp", Builtins::kConvert},
        {"convert_ushort_sat_rtn", Builtins::kConvert},
        {"convert_ushort", Builtins::kConvert},
        {"convert_ushort_rte", Builtins::kConvert},
        {"convert_ushort_rtz", Builtins::kConvert},
        {"convert_ushort_rtp", Builtins::kConvert},
        {"convert_ushort_rtn", Builtins::kConvert},
        {"convert_ushort_sat", Builtins::kConvert},
        {"convert_ushort_sat_rte", Builtins::kConvert},
        {"convert_ushort_sat_rtz", Builtins::kConvert},
        {"convert_ushort_sat_rtp", Builtins::kConvert},
        {"convert_ushort_sat_rtn", Builtins::kConvert},
        {"convert_ushort2", Builtins::kConvert},
        {"convert_ushort2_rte", Builtins::kConvert},
        {"convert_ushort2_rtz", Builtins::kConvert},
        {"convert_ushort2_rtp", Builtins::kConvert},
        {"convert_ushort2_rtn", Builtins::kConvert},
        {"convert_ushort2_sat", Builtins::kConvert},
        {"convert_ushort2_sat_rte", Builtins::kConvert},
        {"convert_ushort2_sat_rtz", Builtins::kConvert},
        {"convert_ushort2_sat_rtp", Builtins::kConvert},
        {"convert_ushort2_sat_rtn", Builtins::kConvert},
        {"convert_ushort3", Builtins::kConvert},
        {"convert_ushort3_rte", Builtins::kConvert},
        {"convert_ushort3_rtz", Builtins::kConvert},
        {"convert_ushort3_rtp", Builtins::kConvert},
        {"convert_ushort3_rtn", Builtins::kConvert},
        {"convert_ushort3_sat", Builtins::kConvert},
        {"convert_ushort3_sat_rte", Builtins::kConvert},
        {"convert_ushort3_sat_rtz", Builtins::kConvert},
        {"convert_ushort3_sat_rtp", Builtins::kConvert},
        {"convert_ushort3_sat_rtn", Builtins::kConvert},
        {"convert_ushort4", Builtins::kConvert},
        {"convert_ushort4_rte", Builtins::kConvert},
        {"convert_ushort4_rtz", Builtins::kConvert},
        {"convert_ushort4_rtp", Builtins::kConvert},
        {"convert_ushort4_rtn", Builtins::kConvert},
        {"convert_ushort4_sat", Builtins::kConvert},
        {"convert_ushort4_sat_rte", Builtins::kConvert},
        {"convert_ushort4_sat_rtz", Builtins::kConvert},
        {"convert_ushort4_sat_rtp", Builtins::kConvert},
        {"convert_ushort4_sat_rtn", Builtins::kConvert},
        {"convert_ushort8", Builtins::kConvert},
        {"convert_ushort8_rte", Builtins::kConvert},
        {"convert_ushort8_rtz", Builtins::kConvert},
        {"convert_ushort8_rtp", Builtins::kConvert},
        {"convert_ushort8_rtn", Builtins::kConvert},
        {"convert_ushort8_sat", Builtins::kConvert},
        {"convert_ushort8_sat_rte", Builtins::kConvert},
        {"convert_ushort8_sat_rtz", Builtins::kConvert},
        {"convert_ushort8_sat_rtp", Builtins::kConvert},
        {"convert_ushort8_sat_rtn", Builtins::kConvert},
        {"convert_ushort16", Builtins::kConvert},
        {"convert_ushort16_rte", Builtins::kConvert},
        {"convert_ushort16_rtz", Builtins::kConvert},
        {"convert_ushort16_rtp", Builtins::kConvert},
        {"convert_ushort16_rtn", Builtins::kConvert},
        {"convert_ushort16_sat", Builtins::kConvert},
        {"convert_ushort16_sat_rte", Builtins::kConvert},
        {"convert_ushort16_sat_rtz", Builtins::kConvert},
        {"convert_ushort16_sat_rtp", Builtins::kConvert},
        {"convert_ushort16_sat_rtn", Builtins::kConvert},
        {"convert_int", Builtins::kConvert},
        {"convert_int_rte", Builtins::kConvert},
        {"convert_int_rtz", Builtins::kConvert},
        {"convert_int_rtp", Builtins::kConvert},
        {"convert_int_rtn", Builtins::kConvert},
        {"convert_int_sat", Builtins::kConvert},
        {"convert_int_sat_rte", Builtins::kConvert},
        {"convert_int_sat_rtz", Builtins::kConvert},
        {"convert_int_sat_rtp", Builtins::kConvert},
        {"convert_int_sat_rtn", Builtins::kConvert},
        {"convert_int", Builtins::kConvert},
        {"convert_int_rte", Builtins::kConvert},
        {"convert_int_rtz", Builtins::kConvert},
        {"convert_int_rtp", Builtins::kConvert},
        {"convert_int_rtn", Builtins::kConvert},
        {"convert_int_sat", Builtins::kConvert},
        {"convert_int_sat_rte", Builtins::kConvert},
        {"convert_int_sat_rtz", Builtins::kConvert},
        {"convert_int_sat_rtp", Builtins::kConvert},
        {"convert_int_sat_rtn", Builtins::kConvert},
        {"convert_int2", Builtins::kConvert},
        {"convert_int2_rte", Builtins::kConvert},
        {"convert_int2_rtz", Builtins::kConvert},
        {"convert_int2_rtp", Builtins::kConvert},
        {"convert_int2_rtn", Builtins::kConvert},
        {"convert_int2_sat", Builtins::kConvert},
        {"convert_int2_sat_rte", Builtins::kConvert},
        {"convert_int2_sat_rtz", Builtins::kConvert},
        {"convert_int2_sat_rtp", Builtins::kConvert},
        {"convert_int2_sat_rtn", Builtins::kConvert},
        {"convert_int3", Builtins::kConvert},
        {"convert_int3_rte", Builtins::kConvert},
        {"convert_int3_rtz", Builtins::kConvert},
        {"convert_int3_rtp", Builtins::kConvert},
        {"convert_int3_rtn", Builtins::kConvert},
        {"convert_int3_sat", Builtins::kConvert},
        {"convert_int3_sat_rte", Builtins::kConvert},
        {"convert_int3_sat_rtz", Builtins::kConvert},
        {"convert_int3_sat_rtp", Builtins::kConvert},
        {"convert_int3_sat_rtn", Builtins::kConvert},
        {"convert_int4", Builtins::kConvert},
        {"convert_int4_rte", Builtins::kConvert},
        {"convert_int4_rtz", Builtins::kConvert},
        {"convert_int4_rtp", Builtins::kConvert},
        {"convert_int4_rtn", Builtins::kConvert},
        {"convert_int4_sat", Builtins::kConvert},
        {"convert_int4_sat_rte", Builtins::kConvert},
        {"convert_int4_sat_rtz", Builtins::kConvert},
        {"convert_int4_sat_rtp", Builtins::kConvert},
        {"convert_int4_sat_rtn", Builtins::kConvert},
        {"convert_int8", Builtins::kConvert},
        {"convert_int8_rte", Builtins::kConvert},
        {"convert_int8_rtz", Builtins::kConvert},
        {"convert_int8_rtp", Builtins::kConvert},
        {"convert_int8_rtn", Builtins::kConvert},
        {"convert_int8_sat", Builtins::kConvert},
        {"convert_int8_sat_rte", Builtins::kConvert},
        {"convert_int8_sat_rtz", Builtins::kConvert},
        {"convert_int8_sat_rtp", Builtins::kConvert},
        {"convert_int8_sat_rtn", Builtins::kConvert},
        {"convert_int16", Builtins::kConvert},
        {"convert_int16_rte", Builtins::kConvert},
        {"convert_int16_rtz", Builtins::kConvert},
        {"convert_int16_rtp", Builtins::kConvert},
        {"convert_int16_rtn", Builtins::kConvert},
        {"convert_int16_sat", Builtins::kConvert},
        {"convert_int16_sat_rte", Builtins::kConvert},
        {"convert_int16_sat_rtz", Builtins::kConvert},
        {"convert_int16_sat_rtp", Builtins::kConvert},
        {"convert_int16_sat_rtn", Builtins::kConvert},
        {"convert_uint", Builtins::kConvert},
        {"convert_uint_rte", Builtins::kConvert},
        {"convert_uint_rtz", Builtins::kConvert},
        {"convert_uint_rtp", Builtins::kConvert},
        {"convert_uint_rtn", Builtins::kConvert},
        {"convert_uint_sat", Builtins::kConvert},
        {"convert_uint_sat_rte", Builtins::kConvert},
        {"convert_uint_sat_rtz", Builtins::kConvert},
        {"convert_uint_sat_rtp", Builtins::kConvert},
        {"convert_uint_sat_rtn", Builtins::kConvert},
        {"convert_uint", Builtins::kConvert},
        {"convert_uint_rte", Builtins::kConvert},
        {"convert_uint_rtz", Builtins::kConvert},
        {"convert_uint_rtp", Builtins::kConvert},
        {"convert_uint_rtn", Builtins::kConvert},
        {"convert_uint_sat", Builtins::kConvert},
        {"convert_uint_sat_rte", Builtins::kConvert},
        {"convert_uint_sat_rtz", Builtins::kConvert},
        {"convert_uint_sat_rtp", Builtins::kConvert},
        {"convert_uint_sat_rtn", Builtins::kConvert},
        {"convert_uint2", Builtins::kConvert},
        {"convert_uint2_rte", Builtins::kConvert},
        {"convert_uint2_rtz", Builtins::kConvert},
        {"convert_uint2_rtp", Builtins::kConvert},
        {"convert_uint2_rtn", Builtins::kConvert},
        {"convert_uint2_sat", Builtins::kConvert},
        {"convert_uint2_sat_rte", Builtins::kConvert},
        {"convert_uint2_sat_rtz", Builtins::kConvert},
        {"convert_uint2_sat_rtp", Builtins::kConvert},
        {"convert_uint2_sat_rtn", Builtins::kConvert},
        {"convert_uint3", Builtins::kConvert},
        {"convert_uint3_rte", Builtins::kConvert},
        {"convert_uint3_rtz", Builtins::kConvert},
        {"convert_uint3_rtp", Builtins::kConvert},
        {"convert_uint3_rtn", Builtins::kConvert},
        {"convert_uint3_sat", Builtins::kConvert},
        {"convert_uint3_sat_rte", Builtins::kConvert},
        {"convert_uint3_sat_rtz", Builtins::kConvert},
        {"convert_uint3_sat_rtp", Builtins::kConvert},
        {"convert_uint3_sat_rtn", Builtins::kConvert},
        {"convert_uint4", Builtins::kConvert},
        {"convert_uint4_rte", Builtins::kConvert},
        {"convert_uint4_rtz", Builtins::kConvert},
        {"convert_uint4_rtp", Builtins::kConvert},
        {"convert_uint4_rtn", Builtins::kConvert},
        {"convert_uint4_sat", Builtins::kConvert},
        {"convert_uint4_sat_rte", Builtins::kConvert},
        {"convert_uint4_sat_rtz", Builtins::kConvert},
        {"convert_uint4_sat_rtp", Builtins::kConvert},
        {"convert_uint4_sat_rtn", Builtins::kConvert},
        {"convert_uint8", Builtins::kConvert},
        {"convert_uint8_rte", Builtins::kConvert},
        {"convert_uint8_rtz", Builtins::kConvert},
        {"convert_uint8_rtp", Builtins::kConvert},
        {"convert_uint8_rtn", Builtins::kConvert},
        {"convert_uint8_sat", Builtins::kConvert},
        {"convert_uint8_sat_rte", Builtins::kConvert},
        {"convert_uint8_sat_rtz", Builtins::kConvert},
        {"convert_uint8_sat_rtp", Builtins::kConvert},
        {"convert_uint8_sat_rtn", Builtins::kConvert},
        {"convert_uint16", Builtins::kConvert},
        {"convert_uint16_rte", Builtins::kConvert},
        {"convert_uint16_rtz", Builtins::kConvert},
        {"convert_uint16_rtp", Builtins::kConvert},
        {"convert_uint16_rtn", Builtins::kConvert},
        {"convert_uint16_sat", Builtins::kConvert},
        {"convert_uint16_sat_rte", Builtins::kConvert},
        {"convert_uint16_sat_rtz", Builtins::kConvert},
        {"convert_uint16_sat_rtp", Builtins::kConvert},
        {"convert_uint16_sat_rtn", Builtins::kConvert},
        {"convert_long", Builtins::kConvert},
        {"convert_long_rte", Builtins::kConvert},
        {"convert_long_rtz", Builtins::kConvert},
        {"convert_long_rtp", Builtins::kConvert},
        {"convert_long_rtn", Builtins::kConvert},
        {"convert_long_sat", Builtins::kConvert},
        {"convert_long_sat_rte", Builtins::kConvert},
        {"convert_long_sat_rtz", Builtins::kConvert},
        {"convert_long_sat_rtp", Builtins::kConvert},
        {"convert_long_sat_rtn", Builtins::kConvert},
        {"convert_long", Builtins::kConvert},
        {"convert_long_rte", Builtins::kConvert},
        {"convert_long_rtz", Builtins::kConvert},
        {"convert_long_rtp", Builtins::kConvert},
        {"convert_long_rtn", Builtins::kConvert},
        {"convert_long_sat", Builtins::kConvert},
        {"convert_long_sat_rte", Builtins::kConvert},
        {"convert_long_sat_rtz", Builtins::kConvert},
        {"convert_long_sat_rtp", Builtins::kConvert},
        {"convert_long_sat_rtn", Builtins::kConvert},
        {"convert_long2", Builtins::kConvert},
        {"convert_long2_rte", Builtins::kConvert},
        {"convert_long2_rtz", Builtins::kConvert},
        {"convert_long2_rtp", Builtins::kConvert},
        {"convert_long2_rtn", Builtins::kConvert},
        {"convert_long2_sat", Builtins::kConvert},
        {"convert_long2_sat_rte", Builtins::kConvert},
        {"convert_long2_sat_rtz", Builtins::kConvert},
        {"convert_long2_sat_rtp", Builtins::kConvert},
        {"convert_long2_sat_rtn", Builtins::kConvert},
        {"convert_long3", Builtins::kConvert},
        {"convert_long3_rte", Builtins::kConvert},
        {"convert_long3_rtz", Builtins::kConvert},
        {"convert_long3_rtp", Builtins::kConvert},
        {"convert_long3_rtn", Builtins::kConvert},
        {"convert_long3_sat", Builtins::kConvert},
        {"convert_long3_sat_rte", Builtins::kConvert},
        {"convert_long3_sat_rtz", Builtins::kConvert},
        {"convert_long3_sat_rtp", Builtins::kConvert},
        {"convert_long3_sat_rtn", Builtins::kConvert},
        {"convert_long4", Builtins::kConvert},
        {"convert_long4_rte", Builtins::kConvert},
        {"convert_long4_rtz", Builtins::kConvert},
        {"convert_long4_rtp", Builtins::kConvert},
        {"convert_long4_rtn", Builtins::kConvert},
        {"convert_long4_sat", Builtins::kConvert},
        {"convert_long4_sat_rte", Builtins::kConvert},
        {"convert_long4_sat_rtz", Builtins::kConvert},
        {"convert_long4_sat_rtp", Builtins::kConvert},
        {"convert_long4_sat_rtn", Builtins::kConvert},
        {"convert_long8", Builtins::kConvert},
        {"convert_long8_rte", Builtins::kConvert},
        {"convert_long8_rtz", Builtins::kConvert},
        {"convert_long8_rtp", Builtins::kConvert},
        {"convert_long8_rtn", Builtins::kConvert},
        {"convert_long8_sat", Builtins::kConvert},
        {"convert_long8_sat_rte", Builtins::kConvert},
        {"convert_long8_sat_rtz", Builtins::kConvert},
        {"convert_long8_sat_rtp", Builtins::kConvert},
        {"convert_long8_sat_rtn", Builtins::kConvert},
        {"convert_long16", Builtins::kConvert},
        {"convert_long16_rte", Builtins::kConvert},
        {"convert_long16_rtz", Builtins::kConvert},
        {"convert_long16_rtp", Builtins::kConvert},
        {"convert_long16_rtn", Builtins::kConvert},
        {"convert_long16_sat", Builtins::kConvert},
        {"convert_long16_sat_rte", Builtins::kConvert},
        {"convert_long16_sat_rtz", Builtins::kConvert},
        {"convert_long16_sat_rtp", Builtins::kConvert},
        {"convert_long16_sat_rtn", Builtins::kConvert},
        {"convert_ulong", Builtins::kConvert},
        {"convert_ulong_rte", Builtins::kConvert},
        {"convert_ulong_rtz", Builtins::kConvert},
        {"convert_ulong_rtp", Builtins::kConvert},
        {"convert_ulong_rtn", Builtins::kConvert},
        {"convert_ulong_sat", Builtins::kConvert},
        {"convert_ulong_sat_rte", Builtins::kConvert},
        {"convert_ulong_sat_rtz", Builtins::kConvert},
        {"convert_ulong_sat_rtp", Builtins::kConvert},
        {"convert_ulong_sat_rtn", Builtins::kConvert},
        {"convert_ulong", Builtins::kConvert},
        {"convert_ulong_rte", Builtins::kConvert},
        {"convert_ulong_rtz", Builtins::kConvert},
        {"convert_ulong_rtp", Builtins::kConvert},
        {"convert_ulong_rtn", Builtins::kConvert},
        {"convert_ulong_sat", Builtins::kConvert},
        {"convert_ulong_sat_rte", Builtins::kConvert},
        {"convert_ulong_sat_rtz", Builtins::kConvert},
        {"convert_ulong_sat_rtp", Builtins::kConvert},
        {"convert_ulong_sat_rtn", Builtins::kConvert},
        {"convert_ulong2", Builtins::kConvert},
        {"convert_ulong2_rte", Builtins::kConvert},
        {"convert_ulong2_rtz", Builtins::kConvert},
        {"convert_ulong2_rtp", Builtins::kConvert},
        {"convert_ulong2_rtn", Builtins::kConvert},
        {"convert_ulong2_sat", Builtins::kConvert},
        {"convert_ulong2_sat_rte", Builtins::kConvert},
        {"convert_ulong2_sat_rtz", Builtins::kConvert},
        {"convert_ulong2_sat_rtp", Builtins::kConvert},
        {"convert_ulong2_sat_rtn", Builtins::kConvert},
        {"convert_ulong3", Builtins::kConvert},
        {"convert_ulong3_rte", Builtins::kConvert},
        {"convert_ulong3_rtz", Builtins::kConvert},
        {"convert_ulong3_rtp", Builtins::kConvert},
        {"convert_ulong3_rtn", Builtins::kConvert},
        {"convert_ulong3_sat", Builtins::kConvert},
        {"convert_ulong3_sat_rte", Builtins::kConvert},
        {"convert_ulong3_sat_rtz", Builtins::kConvert},
        {"convert_ulong3_sat_rtp", Builtins::kConvert},
        {"convert_ulong3_sat_rtn", Builtins::kConvert},
        {"convert_ulong4", Builtins::kConvert},
        {"convert_ulong4_rte", Builtins::kConvert},
        {"convert_ulong4_rtz", Builtins::kConvert},
        {"convert_ulong4_rtp", Builtins::kConvert},
        {"convert_ulong4_rtn", Builtins::kConvert},
        {"convert_ulong4_sat", Builtins::kConvert},
        {"convert_ulong4_sat_rte", Builtins::kConvert},
        {"convert_ulong4_sat_rtz", Builtins::kConvert},
        {"convert_ulong4_sat_rtp", Builtins::kConvert},
        {"convert_ulong4_sat_rtn", Builtins::kConvert},
        {"convert_ulong8", Builtins::kConvert},
        {"convert_ulong8_rte", Builtins::kConvert},
        {"convert_ulong8_rtz", Builtins::kConvert},
        {"convert_ulong8_rtp", Builtins::kConvert},
        {"convert_ulong8_rtn", Builtins::kConvert},
        {"convert_ulong8_sat", Builtins::kConvert},
        {"convert_ulong8_sat_rte", Builtins::kConvert},
        {"convert_ulong8_sat_rtz", Builtins::kConvert},
        {"convert_ulong8_sat_rtp", Builtins::kConvert},
        {"convert_ulong8_sat_rtn", Builtins::kConvert},
        {"convert_ulong16", Builtins::kConvert},
        {"convert_ulong16_rte", Builtins::kConvert},
        {"convert_ulong16_rtz", Builtins::kConvert},
        {"convert_ulong16_rtp", Builtins::kConvert},
        {"convert_ulong16_rtn", Builtins::kConvert},
        {"convert_ulong16_sat", Builtins::kConvert},
        {"convert_ulong16_sat_rte", Builtins::kConvert},
        {"convert_ulong16_sat_rtz", Builtins::kConvert},
        {"convert_ulong16_sat_rtp", Builtins::kConvert},
        {"convert_ulong16_sat_rtn", Builtins::kConvert},
        {"convert_half", Builtins::kConvert},
        {"convert_half_rte", Builtins::kConvert},
        {"convert_half_rtz", Builtins::kConvert},
        {"convert_half_rtp", Builtins::kConvert},
        {"convert_half_rtn", Builtins::kConvert},
        {"convert_half_sat", Builtins::kConvert},
        {"convert_half_sat_rte", Builtins::kConvert},
        {"convert_half_sat_rtz", Builtins::kConvert},
        {"convert_half_sat_rtp", Builtins::kConvert},
        {"convert_half_sat_rtn", Builtins::kConvert},
        {"convert_half", Builtins::kConvert},
        {"convert_half_rte", Builtins::kConvert},
        {"convert_half_rtz", Builtins::kConvert},
        {"convert_half_rtp", Builtins::kConvert},
        {"convert_half_rtn", Builtins::kConvert},
        {"convert_half_sat", Builtins::kConvert},
        {"convert_half_sat_rte", Builtins::kConvert},
        {"convert_half_sat_rtz", Builtins::kConvert},
        {"convert_half_sat_rtp", Builtins::kConvert},
        {"convert_half_sat_rtn", Builtins::kConvert},
        {"convert_half2", Builtins::kConvert},
        {"convert_half2_rte", Builtins::kConvert},
        {"convert_half2_rtz", Builtins::kConvert},
        {"convert_half2_rtp", Builtins::kConvert},
        {"convert_half2_rtn", Builtins::kConvert},
        {"convert_half2_sat", Builtins::kConvert},
        {"convert_half2_sat_rte", Builtins::kConvert},
        {"convert_half2_sat_rtz", Builtins::kConvert},
        {"convert_half2_sat_rtp", Builtins::kConvert},
        {"convert_half2_sat_rtn", Builtins::kConvert},
        {"convert_half3", Builtins::kConvert},
        {"convert_half3_rte", Builtins::kConvert},
        {"convert_half3_rtz", Builtins::kConvert},
        {"convert_half3_rtp", Builtins::kConvert},
        {"convert_half3_rtn", Builtins::kConvert},
        {"convert_half3_sat", Builtins::kConvert},
        {"convert_half3_sat_rte", Builtins::kConvert},
        {"convert_half3_sat_rtz", Builtins::kConvert},
        {"convert_half3_sat_rtp", Builtins::kConvert},
        {"convert_half3_sat_rtn", Builtins::kConvert},
        {"convert_half4", Builtins::kConvert},
        {"convert_half4_rte", Builtins::kConvert},
        {"convert_half4_rtz", Builtins::kConvert},
        {"convert_half4_rtp", Builtins::kConvert},
        {"convert_half4_rtn", Builtins::kConvert},
        {"convert_half4_sat", Builtins::kConvert},
        {"convert_half4_sat_rte", Builtins::kConvert},
        {"convert_half4_sat_rtz", Builtins::kConvert},
        {"convert_half4_sat_rtp", Builtins::kConvert},
        {"convert_half4_sat_rtn", Builtins::kConvert},
        {"convert_half8", Builtins::kConvert},
        {"convert_half8_rte", Builtins::kConvert},
        {"convert_half8_rtz", Builtins::kConvert},
        {"convert_half8_rtp", Builtins::kConvert},
        {"convert_half8_rtn", Builtins::kConvert},
        {"convert_half8_sat", Builtins::kConvert},
        {"convert_half8_sat_rte", Builtins::kConvert},
        {"convert_half8_sat_rtz", Builtins::kConvert},
        {"convert_half8_sat_rtp", Builtins::kConvert},
        {"convert_half8_sat_rtn", Builtins::kConvert},
        {"convert_half16", Builtins::kConvert},
        {"convert_half16_rte", Builtins::kConvert},
        {"convert_half16_rtz", Builtins::kConvert},
        {"convert_half16_rtp", Builtins::kConvert},
        {"convert_half16_rtn", Builtins::kConvert},
        {"convert_half16_sat", Builtins::kConvert},
        {"convert_half16_sat_rte", Builtins::kConvert},
        {"convert_half16_sat_rtz", Builtins::kConvert},
        {"convert_half16_sat_rtp", Builtins::kConvert},
        {"convert_half16_sat_rtn", Builtins::kConvert},
        {"convert_float", Builtins::kConvert},
        {"convert_float_rte", Builtins::kConvert},
        {"convert_float_rtz", Builtins::kConvert},
        {"convert_float_rtp", Builtins::kConvert},
        {"convert_float_rtn", Builtins::kConvert},
        {"convert_float_sat", Builtins::kConvert},
        {"convert_float_sat_rte", Builtins::kConvert},
        {"convert_float_sat_rtz", Builtins::kConvert},
        {"convert_float_sat_rtp", Builtins::kConvert},
        {"convert_float_sat_rtn", Builtins::kConvert},
        {"convert_float", Builtins::kConvert},
        {"convert_float_rte", Builtins::kConvert},
        {"convert_float_rtz", Builtins::kConvert},
        {"convert_float_rtp", Builtins::kConvert},
        {"convert_float_rtn", Builtins::kConvert},
        {"convert_float_sat", Builtins::kConvert},
        {"convert_float_sat_rte", Builtins::kConvert},
        {"convert_float_sat_rtz", Builtins::kConvert},
        {"convert_float_sat_rtp", Builtins::kConvert},
        {"convert_float_sat_rtn", Builtins::kConvert},
        {"convert_float2", Builtins::kConvert},
        {"convert_float2_rte", Builtins::kConvert},
        {"convert_float2_rtz", Builtins::kConvert},
        {"convert_float2_rtp", Builtins::kConvert},
        {"convert_float2_rtn", Builtins::kConvert},
        {"convert_float2_sat", Builtins::kConvert},
        {"convert_float2_sat_rte", Builtins::kConvert},
        {"convert_float2_sat_rtz", Builtins::kConvert},
        {"convert_float2_sat_rtp", Builtins::kConvert},
        {"convert_float2_sat_rtn", Builtins::kConvert},
        {"convert_float3", Builtins::kConvert},
        {"convert_float3_rte", Builtins::kConvert},
        {"convert_float3_rtz", Builtins::kConvert},
        {"convert_float3_rtp", Builtins::kConvert},
        {"convert_float3_rtn", Builtins::kConvert},
        {"convert_float3_sat", Builtins::kConvert},
        {"convert_float3_sat_rte", Builtins::kConvert},
        {"convert_float3_sat_rtz", Builtins::kConvert},
        {"convert_float3_sat_rtp", Builtins::kConvert},
        {"convert_float3_sat_rtn", Builtins::kConvert},
        {"convert_float4", Builtins::kConvert},
        {"convert_float4_rte", Builtins::kConvert},
        {"convert_float4_rtz", Builtins::kConvert},
        {"convert_float4_rtp", Builtins::kConvert},
        {"convert_float4_rtn", Builtins::kConvert},
        {"convert_float4_sat", Builtins::kConvert},
        {"convert_float4_sat_rte", Builtins::kConvert},
        {"convert_float4_sat_rtz", Builtins::kConvert},
        {"convert_float4_sat_rtp", Builtins::kConvert},
        {"convert_float4_sat_rtn", Builtins::kConvert},
        {"convert_float8", Builtins::kConvert},
        {"convert_float8_rte", Builtins::kConvert},
        {"convert_float8_rtz", Builtins::kConvert},
        {"convert_float8_rtp", Builtins::kConvert},
        {"convert_float8_rtn", Builtins::kConvert},
        {"convert_float8_sat", Builtins::kConvert},
        {"convert_float8_sat_rte", Builtins::kConvert},
        {"convert_float8_sat_rtz", Builtins::kConvert},
        {"convert_float8_sat_rtp", Builtins::kConvert},
        {"convert_float8_sat_rtn", Builtins::kConvert},
        {"convert_float16", Builtins::kConvert},
        {"convert_float16_rte", Builtins::kConvert},
        {"convert_float16_rtz", Builtins::kConvert},
        {"convert_float16_rtp", Builtins::kConvert},
        {"convert_float16_rtn", Builtins::kConvert},
        {"convert_float16_sat", Builtins::kConvert},
        {"convert_float16_sat_rte", Builtins::kConvert},
        {"convert_float16_sat_rtz", Builtins::kConvert},
        {"convert_float16_sat_rtp", Builtins::kConvert},
        {"convert_float16_sat_rtn", Builtins::kConvert},

        // Event
        {"retain_event", Builtins::kRetainEvent},
        {"release_event", Builtins::kReleaseEvent},
        {"create_user_event", Builtins::kCreateUserEvent},
        {"is_valid_event", Builtins::kIsValidEvent},
        {"set_user_event_status", Builtins::kSetUserEventStatus},

        // MemoryFence
        {"get_fence", Builtins::kGetFence},
        {"mem_fence", Builtins::kMemFence},
        {"read_mem_fence", Builtins::kReadMemFence},
        {"write_mem_fence", Builtins::kWriteMemFence},
        {"__to_global", Builtins::kToGlobal},
        {"__to_local", Builtins::kToLocal},
        {"__to_private", Builtins::kToPrivate},

        // Geometric
        {"cross", Builtins::kCross},
        {"dot", Builtins::kDot},
        {"distance", Builtins::kDistance},
        {"length", Builtins::kLength},
        {"normalize", Builtins::kNormalize},
        {"fast_distance", Builtins::kFastDistance},
        {"fast_length", Builtins::kFastLength},
        {"fast_normalize", Builtins::kFastNormalize},

        // Image
        {"read_imagef", Builtins::kReadImagef},
        {"read_imagei", Builtins::kReadImagei},
        {"read_imageui", Builtins::kReadImageui},
        {"read_imageh", Builtins::kReadImageh},
        {"write_imagef", Builtins::kWriteImagef},
        {"write_imagei", Builtins::kWriteImagei},
        {"write_imageui", Builtins::kWriteImageui},
        {"write_imageh", Builtins::kWriteImageh},
        {"get_image_width", Builtins::kGetImageWidth},
        {"get_image_height", Builtins::kGetImageHeight},
        {"get_image_depth", Builtins::kGetImageDepth},
        {"get_image_channel_data_type", Builtins::kGetImageChannelDataType},
        {"get_image_channel_order", Builtins::kGetImageChannelOrder},
        {"get_image_dim", Builtins::kGetImageDim},
        {"get_image_array_size", Builtins::kGetImageArraySize},
        {"get_image_num_samples", Builtins::kGetImageNumSamples},

        // Integer
        {"abs", Builtins::kAbs},
        {"abs_diff", Builtins::kAbsDiff},
        {"add_sat", Builtins::kAddSat},
        {"clamp", Builtins::kClamp},
        {"clz", Builtins::kClz},
        {"ctz", Builtins::kCtz},
        {"hadd", Builtins::kHadd},
        {"mad24", Builtins::kMad24},
        {"mad_hi", Builtins::kMadHi},
        {"mad_sat", Builtins::kMadSat},
        {"max", Builtins::kMax},
        {"min", Builtins::kMin},
        {"mul24", Builtins::kMul24},
        {"mul_hi", Builtins::kMulHi},
        {"popcount", Builtins::kPopcount},
        {"rhadd", Builtins::kRhadd},
        {"rotate", Builtins::kRotate},
        {"sub_sat", Builtins::kSubSat},
        {"upsample", Builtins::kUpsample},

        // Math
        {"acos", Builtins::kAcos},
        {"acosh", Builtins::kAcosh},
        {"acospi", Builtins::kAcospi},
        {"asin", Builtins::kAsin},
        {"asinh", Builtins::kAsinh},
        {"asinpi", Builtins::kAsinpi},
        {"atan", Builtins::kAtan},
        {"atan2", Builtins::kAtan2},
        {"atanh", Builtins::kAtanh},
        {"atanpi", Builtins::kAtanpi},
        {"atan2pi", Builtins::kAtan2pi},
        {"cbrt", Builtins::kCbrt},
        {"ceil", Builtins::kCeil},
        {"copysign", Builtins::kCopysign},
        {"cos", Builtins::kCos},
        {"half_cos", Builtins::kHalfCos},
        {"native_cos", Builtins::kNativeCos},
        {"cosh", Builtins::kCosh},
        {"cospi", Builtins::kCospi},
        {"half_divide", Builtins::kHalfDivide},
        {"native_divide", Builtins::kNativeDivide},
        {"erf", Builtins::kErf},
        {"erfc", Builtins::kErfc},
        {"exp", Builtins::kExp},
        {"half_exp", Builtins::kHalfExp},
        {"native_exp", Builtins::kNativeExp},
        {"exp2", Builtins::kExp2},
        {"half_exp2", Builtins::kHalfExp2},
        {"native_exp2", Builtins::kNativeExp2},
        {"exp10", Builtins::kExp10},
        {"half_exp10", Builtins::kHalfExp10},
        {"native_exp10", Builtins::kNativeExp10},
        {"expm1", Builtins::kExpm1},
        {"fabs", Builtins::kFabs},
        {"fdim", Builtins::kFdim},
        {"floor", Builtins::kFloor},
        {"fma", Builtins::kFma},
        {"fmax", Builtins::kFmax},
        {"fmin", Builtins::kFmin},
        {"fmod", Builtins::kFmod},
        {"fract", Builtins::kFract},
        {"frexp", Builtins::kFrexp},
        {"hypot", Builtins::kHypot},
        {"ilogb", Builtins::kIlogb},
        {"ldexp", Builtins::kLdexp},
        {"lgamma", Builtins::kLgamma},
        {"lgamma_r", Builtins::kLgammaR},
        {"log", Builtins::kLog},
        {"half_log", Builtins::kHalfLog},
        {"native_log", Builtins::kNativeLog},
        {"log2", Builtins::kLog2},
        {"half_log2", Builtins::kHalfLog2},
        {"native_log2", Builtins::kNativeLog2},
        {"log10", Builtins::kLog10},
        {"half_log10", Builtins::kHalfLog10},
        {"native_log10", Builtins::kNativeLog10},
        {"log1p", Builtins::kLog1p},
        {"logb", Builtins::kLogb},
        {"mad", Builtins::kMad},
        {"maxmag", Builtins::kMaxmag},
        {"minmag", Builtins::kMinmag},
        {"modf", Builtins::kModf},
        {"nan", Builtins::kNan},
        {"nextafter", Builtins::kNextafter},
        {"pow", Builtins::kPow},
        {"pown", Builtins::kPown},
        {"powr", Builtins::kPowr},
        {"half_powr", Builtins::kHalfPowr},
        {"native_powr", Builtins::kNativePowr},
        {"half_recip", Builtins::kHalfRecip},
        {"native_recip", Builtins::kNativeRecip},
        {"remainder", Builtins::kRemainder},
        {"remquo", Builtins::kRemquo},
        {"rint", Builtins::kRint},
        {"round", Builtins::kRound},
        {"rootn", Builtins::kRootn},
        {"rsqrt", Builtins::kRsqrt},
        {"half_rsqrt", Builtins::kHalfRsqrt},
        {"native_rsqrt", Builtins::kNativeRsqrt},
        {"sin", Builtins::kSin},
        {"half_sin", Builtins::kHalfSin},
        {"native_sin", Builtins::kNativeSin},
        {"sincos", Builtins::kSincos},
        {"sinh", Builtins::kSinh},
        {"sinpi", Builtins::kSinpi},
        {"sqrt", Builtins::kSqrt},
        {"half_sqrt", Builtins::kHalfSqrt},
        {"native_sqrt", Builtins::kNativeSqrt},
        {"tan", Builtins::kTan},
        {"half_tan", Builtins::kHalfTan},
        {"native_tan", Builtins::kNativeTan},
        {"tanh", Builtins::kTanh},
        {"tanpi", Builtins::kTanpi},
        {"tgamma", Builtins::kTgamma},
        {"trunc", Builtins::kTrunc},

        // Relational
        {"isequal", Builtins::kIsequal},
        {"isnotequal", Builtins::kIsnotequal},
        {"isgreater", Builtins::kIsgreater},
        {"isgreaterequal", Builtins::kIsgreaterequal},
        {"isless", Builtins::kIsless},
        {"islessequal", Builtins::kIslessequal},
        {"islessgreater", Builtins::kIslessgreater},
        {"isfinite", Builtins::kIsfinite},
        {"isinf", Builtins::kIsinf},
        {"isnan", Builtins::kIsnan},
        {"isnormal", Builtins::kIsnormal},
        {"isordered", Builtins::kIsordered},
        {"isunordered", Builtins::kIsunordered},
        {"signbit", Builtins::kSignbit},
        {"any", Builtins::kAny},
        {"all", Builtins::kAll},
        {"bitselect", Builtins::kBitselect},
        {"select", Builtins::kSelect},

        // Sync
        {"barrier", Builtins::kBarrier},
        {"work_group_barrier", Builtins::kWorkGroupBarrier},

        // Vector
        {"shuffle", Builtins::kShuffle},
        {"shuffle2", Builtins::kShuffle2},
        {"vec_step", Builtins::kVecStep},
        {"vload", Builtins::kVload},
        {"vload2", Builtins::kVload},
        {"vload3", Builtins::kVload},
        {"vload4", Builtins::kVload},
        {"vload8", Builtins::kVload},
        {"vload16", Builtins::kVload},
        {"vload_half", Builtins::kVloadHalf},
        {"vload_half2", Builtins::kVloadHalf},
        {"vload_half3", Builtins::kVloadHalf},
        {"vload_half4", Builtins::kVloadHalf},
        {"vload_half8", Builtins::kVloadHalf},
        {"vload_half16", Builtins::kVloadHalf},
        {"vloada_half", Builtins::kVloadaHalf},
        {"vloada_half2", Builtins::kVloadaHalf},
        {"vloada_half3", Builtins::kVloadaHalf},
        {"vloada_half4", Builtins::kVloadaHalf},
        {"vloada_half8", Builtins::kVloadaHalf},
        {"vloada_half16", Builtins::kVloadaHalf},
        {"vstore", Builtins::kVstore},
        {"vstore2", Builtins::kVstore},
        {"vstore3", Builtins::kVstore},
        {"vstore4", Builtins::kVstore},
        {"vstore8", Builtins::kVstore},
        {"vstore16", Builtins::kVstore},
        {"vstore_half_1", Builtins::kVstoreHalf},
        {"vstore_half_2", Builtins::kVstoreHalf},
        {"vstore_half_3", Builtins::kVstoreHalf},
        {"vstore_half_4", Builtins::kVstoreHalf},
        {"vstore_half_8", Builtins::kVstoreHalf},
        {"vstore_half_16", Builtins::kVstoreHalf},
        {"vstorea_half_1", Builtins::kVstoreaHalf},
        {"vstorea_half_2", Builtins::kVstoreaHalf},
        {"vstorea_half_3", Builtins::kVstoreaHalf},
        {"vstorea_half_4", Builtins::kVstoreaHalf},
        {"vstorea_half_8", Builtins::kVstoreaHalf},
        {"vstorea_half_16", Builtins::kVstoreaHalf},

        // WorkItem
        {"get_global_id", Builtins::kGetGlobalId},
        {"get_global_size", Builtins::kGetGlobalSize},
        {"get_global_offset", Builtins::kGetGlobalOffset},
        {"get_global_linear_id", Builtins::kGetGlobalLinearId},
        {"get_group_id", Builtins::kGetGroupId},
        {"get_local_id", Builtins::kGetLocalId},
        {"get_local_linear_id", Builtins::kGetLocalLinearId},
        {"get_local_size", Builtins::kGetLocalSize},
        {"get_enqueued_local_size", Builtins::kGetEnqueuedLocalSize},
        {"get_num_groups", Builtins::kGetNumGroups},
        {"get_work_dim", Builtins::kGetWorkDim},

        // Pipe
        {"read_pipe", Builtins::kReadPipe},
        {"write_pipe", Builtins::kWritePipe},
        {"reserve_read_pipe", Builtins::kReserveReadPipe},
        {"commit_read_pipe", Builtins::kCommitReadPipe},
        {"is_valid_reserve_id", Builtins::kIsValidReserveId},
        {"work_group_reserve_read_pipe", Builtins::kWorkGroupReserveReadPipe},
        {"work_group_reserve_write_pipe", Builtins::kWorkGroupReserveWritePipe},
        {"work_group_commit_read_pipe", Builtins::kWorkGroupCommitReadPipe},
        {"work_group_commit_write_pipe", Builtins::kWorkGroupCommitWritePipe},
        {"get_pipe_num_packets", Builtins::kGetPipeNumPackets},
        {"get_pipe_max_packets", Builtins::kGetPipeMaxPackets},

        // SubgroupsKHR
        {"get_sub_group_size", Builtins::kGetSubGroupSize},
        {"get_max_sub_group_size", Builtins::kGetMaxSubGroupSize},
        {"get_num_sub_groups", Builtins::kGetNumSubGroups},
        {"get_enqueued_num_sub_groups", Builtins::kGetEnqueuedNumSubGroups},
        {"get_sub_group_id", Builtins::kGetSubGroupId},
        {"get_sub_group_local_id", Builtins::kGetSubGroupLocalId},
        {"sub_group_barrier", Builtins::kSubGroupBarrier},
        {"sub_group_all", Builtins::kSubGroupAll},
        {"sub_group_any", Builtins::kSubGroupAny},
        {"sub_group_broadcast", Builtins::kSubGroupBroadcast},
        {"sub_group_reduce_add", Builtins::kSubGroupReduceAdd},
        {"sub_group_reduce_min", Builtins::kSubGroupReduceMin},
        {"sub_group_reduce_max", Builtins::kSubGroupReduceMax},
        {"sub_group_scan_exclusive_add", Builtins::kSubGroupScanExclusiveAdd},
        {"sub_group_scan_exclusive_min", Builtins::kSubGroupScanExclusiveMin},
        {"sub_group_scan_exclusive_max", Builtins::kSubGroupScanExclusiveMax},
        {"sub_group_scan_inclusive_add", Builtins::kSubGroupScanInclusiveAdd},
        {"sub_group_scan_inclusive_min", Builtins::kSubGroupScanInclusiveMin},
        {"sub_group_scan_inclusive_max", Builtins::kSubGroupScanInclusiveMax},
        {"sub_group_reserve_read_pipe", Builtins::kSubGroupReserveReadPipe},
        {"sub_group_reserve_write_pipe", Builtins::kSubGroupReserveWritePipe},
        {"sub_group_commit_read_pipe", Builtins::kSubGroupCommitReadPipe},
        {"sub_group_commit_write_pipe", Builtins::kSubGroupCommitWritePipe},
        {"get_kernel_sub_group_count_for_ndrange",
         Builtins::kGetKernelSubGroupCountForNdrange},
        {"get_kernel_max_sub_group_size_for_ndrange",
         Builtins::kGetKernelMaxSubGroupSizeForNdrange},

        // Internal
        {"clspv.fract", Builtins::kClspvFract},
        {"spirv.atomic_xor", Builtins::kSpirvAtomicXor},
        {"spirv.pack.v2f16", Builtins::kSpirvPack},
        {"spirv.unpack.v2f16", Builtins::kSpirvUnpack},

        {"__clspv_vloada_half2", Builtins::kVloadaHalf},
        {"__clspv_vloada_half4", Builtins::kVloadaHalf},

        {"clspv.resource", Builtins::kClspvResource},
        {"clspv.local", Builtins::kClspvLocal},
        {"spirv.op", Builtins::kSpirvOp},
        {"clspv.sampler_var_literal", Builtins::kClspvSamplerVarLiteral},
        {"clspv.composite_construct", Builtins::kClspvCompositeConstruct},

        {"clspv.get_normalized_sampler_mask", Builtins::kClspvGetNormalizedSamplerMask},
};

#endif // CLSPV_LIB_BUILTINSMAP_INC_
